<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="iwpl.project.entities.Employees"%>
<%@page import="iwpl.project.dao.*"%>
<%@page import="iwpl.project.dao.OfficesDAO"%>
<%@page import="iwpl.project.entities.Offices"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" href="css/datepicker.css" type="text/css" />
<script type="text/javascript" src="js/datepicker.js"></script>
<script src="js/jquery-Source.js"></script>
<script type="text/javascript" src="js/jquery-Validation.js"></script>
<script type="text/javascript" src="js/datetimepicker_css.js"></script>

<link rel="stylesheet" href="css/rfnet.css" type="text/css" />
<script type="text/javascript">
  $(document).ready(function()
  {
    $("#commentForm").validate();
  });
  </script>
<link rel="stylesheet" href="css/CommonCSS.css" type="text/css"></link></head>
<script type="text/javascript">			
	function Cancel()
	{
		location.href="/DepartmentManage/Manage_Employee.jsp";
	}			
</script>
<body>	
	<form class="cmxform" id="commentForm" name="frm1" method="post" action="./servlet/EMPLOYEE_Servlet">
	<div>
	<div align="center"> 
		<p style="margin:0px auto; font-family:verdana; font-weight:bold;">Employee Management</p>
	</div>
		<table style="width:350px;height:auto;margin:0 auto">
			
			<tr>
			 <td>Full name </td>
				<td>
					<input type="text" name="txtEmp_Name" style="width:250px" class="required"/>
				</td>
			</tr>
			<tr>
			 <td>Phone</td>
				<td>
					<input type="text" name="txtPhone" style="width:250px" class="required number" maxlength="24" minlength="10"/>
				</td>
			</tr>
			<tr>
			 <td>Sex</td>
				<td>
					<input type="checkbox" name="chkSex" style="width:250px"/>
				</td>
			</tr>
			<!--<tr>
			 <td>Birth Date</td>
				<td>
					<input type="text" name="txtBirthDate" style="width: 160px;"
									id="cdate" class="required">
								<input type="button" style="width: 80px;" value="Select Date"
									onclick="displayDatePicker('txtCreateDate', this);"/>
				</td>
			</tr>-->
		  <tr>
		  		 <td>Birth Date</td>
                 <td width="200">
                     <input type="text" name="txtBirthDate" maxlength="25" size="25"> <a href="javascript:NewCssCal('txtBirthDate','mmddyyyy')"><img
                         src="images/cal.gif" width="16" height="16" alt="Pick a date"></a>
                 </td>                              
             </tr>
			<tr>
			 <td>Address</td>
				<td>
					<input type="text" name="txtAddress" style="width:250px" class="required"/>
				</td>
			</tr>
			<tr>
			<td>Office</td>
				<td>
				<select name="cboOffice" style="width:256px">
			<%
				OfficesDAO objDao= new OfficesDAO();
				List<Offices> lstOff = objDao.findAll();
				for( Iterator<Offices> it = lstOff.iterator(); it.hasNext(); ) {
							Offices oFFICE = (Offices)it.next();
			 %> 				
			<option value="<%=oFFICE.getId()%>" label="<%=oFFICE.getOfficeName()%>"> 
			</option>
			<%} %>
			</select>
			</td>
			</tr>
			<tr>
				<td>
					<button name="btnInsert" type="submit" style="width:70px;height:25px;margin-right:5px;text-align:center" value="btnInsert" class="submit">Save</button>
				</td>
				<td>
					<button name="btnCancel" style="width:70px;height:25px;margin-right:5px;text-align:center" class="submit" onclick="Cancel();">Cancel</button>
				</td>
			</tr>			
		</table>
</div>
</form>
</body>
</html>